﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace bankos
{
    public partial class DollarChoice : Form
    {
        public static int d = 0;// inenn miért kell ide a ststic miért csak így modosul a d értéke, ha butonklikkek teljseülnek?
        public DollarChoice()
        {
            
            InitializeComponent();
        }
        public int D
        {
            get
            {
                return d;
            }
        }


        private void button1_Click(object sender, EventArgs e)
        {
            d = 50;
            
        }

        private void button2_Click(object sender, EventArgs e)
        {
            d = 100;
            
        }

        private void button3_Click(object sender, EventArgs e)
        {
            d = 300;
        }

        private void button4_Click(object sender, EventArgs e)
        {
            BankModel a = new BankModel();
            bool van = a.getMoney(d);
            if (van)
            {
                MessageBox.Show(a.takeMoney(d) + "egyenleg");
            }
            else
            {
                MessageBox.Show("Nincs elég fedezet!!!");
            }
        }

        private void button5_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}